package com.zret.oasys.factory;

import com.zret.oasys.operation.attendance.AttendanceServletOperation;

public class AttendanceServletFactory {
	// 返回值是operation继承的接口(为了多态)
		 public static AttendanceServletOperation getOpreation(String op)  {
			 String classStr = "com.zret.oasys.operation.attendance." + op;
			 //System.out.println(classStr);
			 Class<?> cla;
			 Object obj = null;
			try {
				cla = Class.forName(classStr);
				obj = cla.newInstance();
			} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			 
			 return (AttendanceServletOperation) obj;
		 }

}
